package org.zjx.window.window.impl;

import com.sun.jna.platform.win32.WinDef;
import org.zjx.window.operation.impl.GameOperator;
import org.zjx.window.util.HwndUtil;
import org.zjx.window.window.AbstractWindow;

import java.awt.*;
import java.util.List;
import java.util.stream.Collectors;

public class GameWindow extends AbstractWindow {
    private static final String className = "WSGAME";
    private static final String titleName = null;

    public static List<WinDef.HWND> getWindows() {
        List<WinDef.HWND> hwndList =  HwndUtil.findWindows(className,titleName);
        return hwndList.stream().filter(hwnd -> HwndUtil.getWindowTitle(hwnd).contains("[")).collect(Collectors.toList());
    }

    public GameWindow(WinDef.HWND hwnd) {
        super(hwnd, new GameOperator());
    }

    @Override
    public Rectangle getTrueBounds() {
        return new Rectangle(8, 31, 800, 600);
    }
}
